using Core;

namespace g_gongjianta
{
    [Window((int)EWnd.LoginWnd)]
    public class LoginWnd : Window
    {
        //@formatter:off
        [UIField("root/panel/btn_start")]
        private readonly UIButton btnStart;
        //@formatter:on

        protected override void OnShow()
        {
            btnStart.onClick += OnBtnStartClickHandler;
        }

        protected override void OnClose()
        {
            btnStart.onClick -= OnBtnStartClickHandler;
        }

        private void OnBtnStartClickHandler()
        {
            G.Evt.Run(LoginEvent.LoadData);
            G.Evt.Run(LoginEvent.Login);

            G.UI.Close(this);
        }
    }
}